home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / pangomm-1.4 / pangomm / renderer.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-20  |  9.6 KB  |  323 lines

  1. // -*- c++ -*-
  2. // Generated by gtkmmproc -- DO NOT MODIFY!
  3. #ifndef _PANGOMM_RENDERER_H
  4. #define _PANGOMM_RENDERER_H
  5.  
  6. #include <glibmm.h>
  7.  
  8. /* $Id: renderer.hg,v 1.3 2005/01/08 20:54:20 murrayc Exp $ */
  9.  
  10. /* renderer.h
  11.  *
  12.  * Copyright(C) 2004 The gtkmm Development Team
  13.  *
  14.  * This library is free software; you can redistribute it and/or
  15.  * modify it under the terms of the GNU Library General Public
  16.  * License as published by the Free Software Foundation; either
  17.  * version 2 of the License, or(at your option) any later version.
  18.  *
  19.  * This library is distributed in the hope that it will be useful,
  20.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  22.  * Library General Public License for more details.
  23.  *
  24.  * You should have received a copy of the GNU Library General Public
  25.  * License along with this library; if not, write to the Free
  26.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  27.  */
  28.  
  29.  
  30. #include <glibmm/object.h>
  31. #include <pangomm/context.h>
  32. #include <pangomm/glyphstring.h>
  33. #include <pangomm/layout.h>
  34. #include <pangomm/layoutline.h>
  35. #include <pangomm/types.h> //For Matrix.
  36.  
  37.  
  38. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  39. typedef struct _PangoRenderer PangoRenderer;
  40. typedef struct _PangoRendererClass PangoRendererClass;
  41. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  42.  
  43.  
  44. namespace Pango
  45. { class Renderer_Class; } // namespace Pango
  46. namespace Pango
  47. {
  48.  
  49.  
  50. /** @addtogroup pangommEnums Enums and Flags */
  51.  
  52. /**
  53.  * @ingroup pangommEnums
  54.  */
  55. enum RenderPart
  56. {
  57.   RENDER_PART_FOREGROUND,
  58.   RENDER_PART_BACKGROUND,
  59.   RENDER_PART_UNDERLINE,
  60.   RENDER_PART_STRIKETHROUGH
  61. };
  62.  
  63. } // namespace Pango
  64.  
  65.  
  66. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  67. namespace Glib
  68. {
  69.  
  70. template <>
  71. class Value<Pango::RenderPart> : public Glib::Value_Enum<Pango::RenderPart>
  72. {
  73. public:
  74.   static GType value_type() G_GNUC_CONST;
  75. };
  76.  
  77. } // namespace Glib
  78. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  79.  
  80.  
  81. namespace Pango
  82. {
  83.  
  84.  
  85. /** TODO.
  86.  */
  87.  
  88. class Renderer : public Glib::Object
  89. {
  90.   
  91. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  92.  
  93. public:
  94.   typedef Renderer CppObjectType;
  95.   typedef Renderer_Class CppClassType;
  96.   typedef PangoRenderer BaseObjectType;
  97.   typedef PangoRendererClass BaseClassType;
  98.  
  99. private:  friend class Renderer_Class;
  100.   static CppClassType renderer_class_;
  101.  
  102. private:
  103.   // noncopyable
  104.   Renderer(const Renderer&);
  105.   Renderer& operator=(const Renderer&);
  106.  
  107. protected:
  108.   explicit Renderer(const Glib::ConstructParams& construct_params);
  109.   explicit Renderer(PangoRenderer* castitem);
  110.  
  111. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  112.  
  113. public:
  114.   virtual ~Renderer();
  115.  
  116. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  117.   static GType get_type()      G_GNUC_CONST;
  118.   static GType get_base_type() G_GNUC_CONST;
  119. #endif
  120.  
  121.   ///Provides access to the underlying C GObject.
  122.   PangoRenderer*       gobj()       { return reinterpret_cast<PangoRenderer*>(gobject_); }
  123.  
  124.   ///Provides access to the underlying C GObject.
  125.   const PangoRenderer* gobj() const { return reinterpret_cast<PangoRenderer*>(gobject_); }
  126.  
  127.   ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
  128.   PangoRenderer* gobj_copy();
  129.  
  130. private:
  131.  
  132.  
  133. protected:
  134.  
  135. public:
  136.  
  137.   
  138.   /** Draws @a layout  with the specified Pango::Renderer.
  139.    * 
  140.    * Since: 1.8
  141.    * @param layout A Pango::Layout.
  142.    * @param x X position of left edge of baseline, in user space coordinates
  143.    * in Pango units.
  144.    * @param y X position of left edge of baseline, in user space coordinates
  145.    * in Pango units.
  146.    */
  147.   void draw_layout(const Glib::RefPtr<Layout>& layout, int x, int y);
  148.   
  149.   /** Draws @a line  with the specified Pango::Renderer.
  150.    * 
  151.    * Since: 1.8
  152.    * @param line A Pango::LayoutLine.
  153.    * @param x X position of left edge of baseline, in user space coordinates
  154.    * in Pango units.
  155.    * @param y X position of left edge of baseline, in user space coordinates
  156.    * in Pango units.
  157.    */
  158.   void draw_layout_line(const Glib::RefPtr<LayoutLine>& line, int x, int y);
  159.   
  160.   /** Draws the glyphs in @a glyphs  with the specified Pango::Renderer.
  161.    * 
  162.    * Since: 1.8
  163.    * @param font A Pango::Font.
  164.    * @param glyphs A Pango::GlyphString.
  165.    * @param x X position of left edge of baseline, in user space coordinates
  166.    * in Pango units.
  167.    * @param y X position of left edge of baseline, in user space coordinates
  168.    * in Pango units.
  169.    */
  170.   void draw_glyphs(const Glib::RefPtr<Font>& font, const GlyphString& glyphs, int x, int y);
  171.   
  172.   /** Draws an axis-aligned rectangle in user space coordinates with the
  173.    * specified Pango::Renderer.
  174.    * 
  175.    * Since: 1.8
  176.    * @param part Type of object this rectangle is part of.
  177.    * @param x X position at which to draw rectangle, in user space coordinates in Pango units.
  178.    * @param y Y position at which to draw rectangle, in user space coordinates in Pango units.
  179.    * @param width Width of rectangle in PangoUnits in user space coordinates.
  180.    * @param height Height of rectangle in PangoUnits in user space coordinates.
  181.    */
  182.   void draw_rectangle(RenderPart part, int x, int y, int width, int height);
  183.   
  184.   /** Draw a squiggly line that approximately covers the given rectangle
  185.    * in the style of an underline used to indicate a spelling error.
  186.    * (The width of the underline is rounded to an integer number
  187.    * of up/down segments and the resulting rectangle is centered
  188.    * in the original rectangle)
  189.    * 
  190.    * Since: 1.8
  191.    * @param x X coordinate of underline, in Pango units in user coordinate system.
  192.    * @param y Y coordinate of underline, in Pango units in user coordinate system.
  193.    * @param width Width of underline, in Pango units in user coordinate system.
  194.    * @param height Height of underline, in Pango units in user coordinate system.
  195.    */
  196.   void draw_error_underline(int x, int y, int width, int height);
  197.   
  198.   /** Draws a trapezoid with the parallel sides aligned with the X axis
  199.    * using the given Pango::Renderer; coordinates are in device space.
  200.    * 
  201.    * Since: 1.8
  202.    * @param part Type of object this trapezoid is part of.
  203.    * @param y1 Y coordinate of top of trapezoid.
  204.    * @param x11 X coordinate of left end of top of trapezoid.
  205.    * @param x21 X coordinate of right end of top of trapezoid.
  206.    * @param y2 X coordinate of top of trapezoid.
  207.    * @param x12 X coordinate of left end of top of trapezoid.
  208.    * @param x22 Y coordinate of left end of top of trapezoid.
  209.    */
  210.   void draw_trapezoid(RenderPart part, double y1, double x11, double x21, double y2, double x12, double x22);
  211.   
  212.   /** Draws a single glyph with coordinates in device space.
  213.    * 
  214.    * Since: 1.8
  215.    * @param font A Pango::Font.
  216.    * @param glyph The glyph index of a single glyph.
  217.    * @param x X coordinate of left edge of baseline of glyph.
  218.    * @param y Y coordinate of left edge of baseline of glyph.
  219.    */
  220.   void draw_glyph(const Glib::RefPtr<Font>& font, Glyph glyph, double x, double y);
  221.  
  222.   
  223.   /** Does initial setup before rendering operations on @a renderer .
  224.    * deactivate() should be called when done drawing.
  225.    * Calls such as draw_layout() automatically
  226.    * activate the layout before drawing on it. Calls to
  227.    * activate() and deactivate() can
  228.    * be nested and the renderer will only be initialized and
  229.    * deinitialized once.
  230.    * 
  231.    * Since: 1.8
  232.    */
  233.   void activate();
  234.   
  235.   /** Cleans up after rendering operations on @a renderer . See
  236.    * docs for activate().
  237.    * 
  238.    * Since: 1.8
  239.    */
  240.   void deactivate();
  241.  
  242.   
  243.   /** Informs Pango that the way that the renderering is done
  244.    * for @a part  has changed in a way that would prevent multiple
  245.    * pieces being joined together into one drawing call. For
  246.    * instance, if a subclass of Pango::Renderer was to add a stipple
  247.    * option for drawing underlines, it needs to call
  248.    * 
  249.    * @code
  250.    * pango_renderer_part_changed (render, PANGO_RENDER_PART_UNDERLINE);
  251.    * @endcode
  252.    * 
  253.    * When the stipple changes or underlines with different stipples
  254.    * might be joined together. Pango automatically calls this for
  255.    * changes to colors. (See set_color())
  256.    * 
  257.    * Since: 1.8
  258.    * @param part The part for which rendering has changed.
  259.    */
  260.   void part_changed(RenderPart part);
  261.  
  262.   
  263.   /** Sets the color for part of the rendering.
  264.    * 
  265.    * Since: 1.8
  266.    * @param part The part to change the color of.
  267.    * @param color The new color or <tt>0</tt> to unset the current color.
  268.    */
  269.   void set_color(RenderPart part, const Color& color);
  270.   
  271.  
  272.   /** Gets the current rendering color for the specified part.
  273.    * @param part The part to get the color for.
  274.    * @return The color for the specified part, or <tt>0</tt>
  275.    * if it hasn't been set and should be inherited from the
  276.    * environment.
  277.    * 
  278.    * Since: 1.8.
  279.    */
  280.   Color get_color(RenderPart part) const;
  281.  
  282.   
  283.   /** Sets the transformation matrix that will be applied when rendering.
  284.    * 
  285.    * Since: 1.8
  286.    * @param matrix A Pango::Matrix, or <tt>0</tt> to unset any existing matrix.
  287.    * (No matrix set is the same as setting the identity matrix.).
  288.    */
  289.   void set_matrix(const Matrix& matrix);
  290.   //TOOD: _WRAP_METHOD(Matrix get_matrix(), pango_renderer_get_matrix)
  291.   //Note: The returned matrix is owned by Pango and must not be modified or freed.
  292.  
  293.  
  294. public:
  295.  
  296. public:
  297.   //C++ methods used to invoke GTK+ virtual functions:
  298.  
  299. protected:
  300.   //GTK+ Virtual Functions (override these to change behaviour):
  301.  
  302.   //Default Signal Handlers::
  303.  
  304.  
  305. };
  306.  
  307. } /* namespace Pango */
  308.  
  309.  
  310. namespace Glib
  311. {
  312.   /** @relates Pango::Renderer
  313.    * @param object The C instance
  314.    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
  315.    * @result A C++ instance that wraps this C instance.
  316.    */
  317.   Glib::RefPtr<Pango::Renderer> wrap(PangoRenderer* object, bool take_copy = false);
  318. }
  319.  
  320.  
  321. #endif /* _PANGOMM_RENDERER_H */
  322.  
  323.